/**
 * Copyright (C), 2018-2020, 飞尔智能有限公司
 * FileName: UserService
 * Author:   杨乐
 */
package com.yangle.feign;

import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @description:
 * @Author 杨乐
 * @Date 2020/2/3 21:10
 * @Version 1.0
 **/
@Component
public class UserFeignFallBack implements UserFeign {

    @Override
    public User getUser(String name) {
        User user=new User();
        user.setName(name);
        user.setEmail("接口请求失败");
        return user;
    }

    @Override
    public User getUser(@RequestParam Map<String, String> param) {
        User user=new User();
        user.setName(param.get("name"));
        user.setEmail("接口请求失败");
        return user;
    }

    @Override
    public User addUser(String name, String email) {
        User user=new User();
        user.setName(name);
        user.setEmail("接口请求失败");
        return user;
    }

    @Override
    public User addUser(@RequestBody User user) {
        return user;
    }
}
    
